unit SmallStruct.Core.TSSObjectFactory;

interface

uses Classes,
  SmallStruct.Core,
  SmallStruct.Core.TSSRuntimeObject,
  SmallStruct.Core.TSSSystemObject;

type
  TSSObjectFactory = class(TSSRuntimeObject)
  private
    _SystemObject: TSSSystemObject;
  protected
    function GetSystemObject: ISSSystemObject;
    function QueryClass(const AClassName: string): TComponentClass;
  public
    constructor Create(AOwner: TComponent); override;
  end;

implementation

{ TSSObjectFactory }

constructor TSSObjectFactory.Create(AOwner: TComponent);
begin
  inherited;
  _SystemObject := AOwner as TSSSystemObject;
end;

function TSSObjectFactory.GetSystemObject: ISSSystemObject;
begin
  Result := _SystemObject;
end;

function TSSObjectFactory.QueryClass(const AClassName: string): TComponentClass;
begin
  Result := (GetSystemObject.GetClassTable as ISSClassTable).QueryClass(AClassName);
end;

end.
